import request from '../request'
import qs from 'qs'
import {API} from "@/api/config";

export default {
    /**
     *  向后端传递请求参数是json,通过qs转换为参数格式,后端不需要@RequestBody注解接收参数
     */
    list(json) {
        return request({
            url:"carsystem/sysDictData/list",
            method: "post",
            data: qs.stringify(json),
        });
    },
    type() {
        return request({
            url:"carsystem/sysDictData/type",
            method: "post",
            data: qs.stringify(null),
        });
    },
    add(json) {
        return request({
            url:"carsystem/sysDictData/add",
            method: "post",
            data: qs.stringify(json),
        });
    },
    delete(dictCode) {
        return request({
            url:API+"carsystem/sysDictData/delete?dictCode="+dictCode,
            method: "post",
            data: null,
        });
    },
    update(json) {
        return request({
            url:"carsystem/sysDictData/update",
            method: "post",
            data: qs.stringify(json),
        });
    },
    deAll(id) {
        return request({
            url:API+"carsystem/sysDictData/deAll?id="+id,
            method: "post",
            data: null,
        });
    },

}